class MyPromise {
    status = 'pending'
    value = null
    reason = null
    constructor(fn) {
       const resolev = (value)=>{
        if(this.status === 'pending'){
            this.status = 'fulfilled'
            this.value = value
        }
        }
        const reject = (reason)=> {
           if(this.status === 'pending'){
               this.status = 'rejected'
               this.reason = reason
           }
        }
        try {
            fn(resolev,reject)
        } catch (error) {  
            reject(error)
        }
    }
}